package com.design.factory;

/**
 * Created by yijy on 2017/11/8.
 * 普通工厂模式
 */
public class FactoryDesiger {

    public Sender producer(String str){
        if("mail".equals(str)){
            return new MailSender();
        }else if ("sms".equals(str)){
            return new SmsSender();
        }else{
            System.out.println("is not visable");
            return null;
        }
    }
}
